//
//  TraveListTableViewCell.m
//  Haliaeetus
//
//  Created by junli hou on 2018/3/28.
//  Copyright © 2018年 BMY. All rights reserved.
//

#import "TraveListTableViewCell.h"

@implementation TraveListTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self= [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        
        UIImageView *bgView = [[UIImageView alloc]init];
        bgView.image=[UIImage imageNamed:@"tr_bg"];
        bgView.frame = CGRectMake(12,10,WS_SCREEN_FRAME_WIDTH-24,230);
        [self.contentView addSubview:bgView];
        
        
        UIImageView *hotelImageView = [[UIImageView alloc]init];
        hotelImageView.image=[UIImage imageNamed:@"hotel_icon"];
        hotelImageView.frame = CGRectMake(33,32,16,16);
        [self.contentView addSubview:hotelImageView];
        UIImageView *locationImageView = [[UIImageView alloc]init];
        locationImageView.image=[UIImage imageNamed:@"location_icon"];
        locationImageView.frame = CGRectMake(33,35+CGRectGetMaxY(hotelImageView.frame),16,16);
        [self.contentView addSubview:locationImageView];
        

        
        UIImageView *dateImageView = [[UIImageView alloc]init];
        dateImageView.image=[UIImage imageNamed:@"bad_icon"];
        dateImageView.frame = CGRectMake(177,171,20,20);
        [self.contentView addSubview:dateImageView];
        
        
        

        [self.contentView addSubview:self.checkoOutDate];
        [self.contentView addSubview:self.cityName];
        [self.contentView addSubview:self.spaceName];
        [self.contentView addSubview:self.checkInDate];

    }
    return self;
}
- (UILabel *)cityName{
    if (!_cityName) {
        _cityName = [[UILabel alloc]init];
        _cityName.frame = CGRectMake(59,70,WS_SCREEN_FRAME_WIDTH-120,40);
        _cityName.font = [UIFont systemFontOfSize:14];
        _cityName.numberOfLines=2;
        _cityName.textColor = WS_RGB(68, 69, 60);
    }
    return _cityName;
}

- (UILabel *)spaceName
{
    if (!_spaceName) {
        _spaceName = [[UILabel alloc]init];
        _spaceName.frame = CGRectMake(59,20,WS_SCREEN_FRAME_WIDTH-120,40);
        _spaceName.font = [UIFont systemFontOfSize:14];
        _spaceName.numberOfLines=2;
        _spaceName.textColor = WS_RGB(68, 69, 60);
    }
    return _spaceName;
}

- (UILabel *)checkInDate
{
    if (!_checkInDate) {
        _checkInDate = [[UILabel alloc]init];
        _checkInDate.frame = CGRectMake(59,167,135,28);
        _checkInDate.font = [UIFont systemFontOfSize:20];
        _checkInDate.textAlignment=NSTextAlignmentLeft;
        _checkInDate.textColor = WS_RGB(255, 134, 35);
    }
    return _checkInDate;
}


- (UILabel *)checkoOutDate
{
    if (!_checkoOutDate) {
        _checkoOutDate = [[UILabel alloc]init];
        _checkoOutDate.frame = CGRectMake(WS_SCREEN_FRAME_WIDTH-59-135,167,135,28);
        _checkoOutDate.font = [UIFont systemFontOfSize:20];
        _checkoOutDate.textAlignment=NSTextAlignmentRight;
        _checkoOutDate.textColor = WS_RGB(255, 134, 35);
    }
    return _checkoOutDate;
}






- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


@end
